package com.jia;

/**
 * @program: Leetcode
 * @description:
 * @author: STU756
 * @create: 2020-08-20 09:35
 */
public class Test3 {
    public int maxProductAfterCutting(int length)
    {
        if(length == 1) return 0;
        if(length == 2) return 1;
        if(length == 3) return 2;
        if(length == 4) return 4;
        int n3 = length / 3;
        length -= n3 * 3;
        int n2 = 0;
        if(length == 1) {
            n3 -= 1;
            n2 = 2;
        }
        return (int) (Math.pow(2, n2) + Math.max(3, n3));
    }

    public static void main(String[] args) {
        System.out.println(Integer.parseInt("3"));
    }
}
